package com.cssiot.scala.junit

import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner

  

import javax.annotation.Resource
import com.cssiot.scala.dao.impl.GzzInfoTestDaoImpl
import com.cssiot.scala.entity.Gzz01InfoTest

@RunWith(classOf[SpringJUnit4ClassRunner])
@ContextConfiguration(locations = Array( "classpath:applicationContext.xml" ))
class TestScala {
  @Resource(name="gzzInfoTestDao")
   var gzzInfoTestDao:GzzInfoTestDaoImpl = _
  
// @Autowired @Qualifier("john") var john:GzzInfoTestDaoImpl = _
 
   @Test 
  def testScalaJunit(): Unit = { 
//     println(gzzInfoTestDao)
    var o=new Gzz01InfoTest("123","jiaojingTest","0.2555")
//     gzzInfoTestDao.add(o)
     o.protocolID="jiaojingTest2222"
     gzzInfoTestDao.saveObject(o)
//    gzzInfoTestDao.
//    o.id="ddd"
    println(o.toString())
//    val p=new Gzz01InfoTest
  /*  println(gzzInfoTestDao.add(o))
    println("The First Scala Unit Test"); */
   } 
  
}